/**
 * 
 */
package com.Dialogs;


import android.app.AlertDialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.Dialogs.DialogOneText.OnClickOkListener;
import com.shareup.R;
import com.shareup.R.id;


public class DialogTwoTexts extends AlertDialog {

    private OnTwoClickOkListener OnClick;

    private String hint;

    private String hint2;

    public DialogTwoTexts(Context context, OnClickOkListener OnClick) {

        super(context);
        this.context = context;
    }

    public String getHint() {

        return this.hint;
    }

    public void setHint(String hint) {

        this.hint = hint;
    }

    public String getHint2() {

        return this.hint2;
    }

    public void setHint2(String hint2) {

        this.hint2 = hint2;
    }

    public void setOnClick(OnTwoClickOkListener onClick) {

        this.OnClick = onClick;
    }

    private Context context;

    public void inflate() {

        View v = LayoutInflater.from(context).inflate(R.layout.dialog_two_texts, null);
        this.setView(v);
        final EditText text = (EditText) v.findViewById(id.edit1);
        final EditText text2 = (EditText) v.findViewById(id.edit2);
        text.setHint(hint);
        text2.setHint(hint2);
        Button but = (Button) v.findViewById(R.id.button_OK);
        but.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {

                if (OnClick != null)
                    OnClick.OnClick(text.getText().toString(), text2.getText().toString());

            }

        });

    }

    @Override
    public void setTitle(CharSequence title) {

    }

    public interface OnTwoClickOkListener {

        void OnClick(String text1, String text2);

    }

}
